package com.atguigu.day17.work;

import com.sun.javafx.image.impl.IntArgb;

import java.util.Arrays;

public class Work4 {
    public static void main(String[] args) {
        Integer[]arr={1,2,3,4,5};
        reverse(arr);
        System.out.println(Arrays.toString(arr));
    }
    public static <T> void reverse(T[] arr) {
        for (int i = 0; i < arr.length/2; i++) {
            T temp = arr[i];
            arr[i]=arr[arr.length-1-i];
            arr[arr.length-1-i]=temp;
        }
    }
}
